import 'dart:convert';

import 'package:flutter/material.dart';

class RequestDamo extends StatefulWidget {
  RequestDamo({Key key}) : super(key: key);
  @override
  _RequestDamoState createState() => _RequestDamoState();
}

class _RequestDamoState extends State<RequestDamo> {
  @override
  Widget build(BuildContext context) {
    var m = {'name': '张三', 'age': 18};

    var j = json.encode(m);

    var jsonStr = '{"name":"张三","age":18}';
    var zs = json.decode(jsonStr);
    print(zs is Map);

    // print(j is String);
    return Scaffold(
        appBar: AppBar(
          title: Text('RequestDamo'),
        ),
        body: Container(
          child: Column(
            children: [
              Text('RequestDamo'),
            ],
          ),
        ));
  }
}
